<template>
  <div class="ba_f pad_20">
    <div class="flex-bet ba_f5 storeItem pad_20">
      <div class="flex">
        <div class="shimg mar_lr10">
          <img src="~@/assets/shop/shimg.png" class />
        </div>
        <div>
          <div class="shtitle color_3">
            <span>收银台管理地址</span>
            <span class="fon_12 color_9 fnormal mar_l10">请勿在同一浏览器同时打收银台，防止数据错乱！</span>
          </div>
          <div class="color_3 fon_14 mar_t10">链接地址：{{ url }}</div>
          <div class="flex mar_t20">
            <div class="lllx mar_r10">
              <el-button size="medium" plain @click="handleEditClick(url)">点击访问</el-button>
            </div>
          </div>
        </div>
      </div>
      <div class="codeimg flex-center">
        <img src="~@/assets/shop/codeimg.png" class />
      </div>
    </div>
    <base-set-l ref="baseSetL"></base-set-l>
    <div class="mar_t20 ba_f pad_20 t_c">
      <el-button type="primary" @click="submitForm">保存</el-button>
    </div>
  </div>
</template>
<script>
import index from '@/api/index';
import baseSetL from './components/base-set-l.vue';
export default {
  components: { baseSetL },
  data() {
    return {
      activeName: 'orderset',
      form2: {
        instoreOpen: '1',
        distanceOpen: '1',
        distance: '',
        payMode: ['1', '2'],
        autoClose: '2',
        closeTime: '',
        orderMode: ['1', '2'],
        fastOpen: '1',
        authOpen: '1',
        Orderdiscount: ['1', '2'],
        background: '',
        fastAutoClose: '2',
        fastCloseTime: ''
      },
      url: '',
      instore: ''
    };
  },
  created() {
    const publishUrl = 'https://bkycms.com/addons/yb_wm/views/cashier/index.html';
    this.url = index.isDev ? publishUrl : location.href.match(/(\S*)views/)[1] + 'views/cashier/index.html';
    console.log(this.url);
  },
  methods: {
    handleEditClick(url) {
      window.open(url, '_blank');
    },
    copyText() {},
    submitForm() {
      this.$refs.baseSetL.submit();
    }
  }
};
</script>
<style>
.el-input-number.is-controls-right .el-input__inner {
  width: 140px;
}
</style>
<style lang="scss" scoped>
.storeItem {
  background: #fafdff;
  border: 1px solid #eceff1;
  border-radius: 5px;
}
</style>

